
import { defineAmisPlugin, getApiTpl, getInputTpl } from '../../base/util';
import ImageTextList, { type IProps } from './fc';

export default defineAmisPlugin<IProps>(({ amisEditor }) => {
  const { getSchemaTpl } = amisEditor;

  return {
    component: ImageTextList,
    options: {
      type: 'portal-image-text',
      name: '图文列表',
      order: 11, 
      icon: 'FileImageOutlined',
      description: '图文列表',
      panelTitle: '图文列表面板',
      scaffold: {
        title: '图文列表',
      },
      panelTabs: [
        {
          title: '常规',
          body: [
            getSchemaTpl('collapseGroup', [
              {
                title: '基本',
                body: [
                  getInputTpl('title', { label: '标题' }),
                  getInputTpl('imageWidth', { label: '图片宽度', type: 'number' }),
                ],
              },
              getApiTpl(),
            ]),
          ],
        },
        {
          title: '外观',
          body: [
            getSchemaTpl('collapseGroup', [
              ...getSchemaTpl('theme:common', { styleName: 'style' }),
            ]),
          ],
        },
      ],
    },
  };
});
